<?php
$conexion=mysql_connect("localhost", "root", "") or die ("Error al Conectar!");
mysql_select_db("hazarte") or die ("Verifique la Base de Datos");

$tipo = $_POST["tipo"];

$sql = "SELECT * FROM  `imagenes` WHERE  `tipo` =  '$tipo'";
$resulset = mysql_query($sql);
$rows = array();
while ($row = mysql_fetch_array($resulset)) {
	$rows[] = array_map('utf8_encode', $row);
}
if(empty($rows)){
	$rows = false;
}
echo json_encode($rows);
?>